package operations;

import book.BookList;
import tools.NameComparator;

/**
 * Created with IntelliJ IDEA
 * Description:展示书架
 * User:22954
 * Date:2024-01-12
 * Time:20:35
 */
public class DisplayOperation implements IOperation {
    @Override
    public void work(BookList bookList) {
//      System.out.println("展示书架");
        NameComparator nameComparator = new NameComparator();
        bookList.getBooks().sort(nameComparator);
        bookList.getBooks().forEach((x) ->
                System.out.println(x.toString()));

    }
}
